#pragma once
#include <iostream>
#include <assert.h>


class date
{
public:
	date(int year, int month, int day)
	{
		_year = year;
		_month = month;
		_day = day;
	}

	int GetMonthDay(int year,int month)
	{
		static int days[] = { -1,31,28,31,30,31,30,31,31,30,31,30,31 };
		if ((month == 2)&&((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)))
		{
			return 29;
		}
		return days[month];
	}

	date(const date& d)
	{
		_year = d._year;
		_month = d._month;
		_day = d._day;
	}

	~date()
	{
		_year = 0;
		_month = 0;
		_day = 0;
	}

	void print();

	bool operator<(const date& d);
	bool operator==(const date& d);
	bool operator<=(const date& d);
	bool operator>(const date& d);
	bool operator>=(const date& d);
	bool operator!=(const date& d);

	date& operator+=(int day);
	date operator+(int day);
	date& operator-=(int day);
	date operator-(int day);

	int operator-(date& d);

private:
	int _year;
	int _month;
	int _day;
};